import Home from '../pages/Home';
import Login from '../pages/Login';
import Register from '../pages/Register';
import Search from '../pages/Search';
import Detail from '../pages/Detail';
import AddCartSuccess from '../pages/AddCartSuccess';
import ShopCart from '../pages/ShopCart';
import Trade from '../pages/Trade';
import Pay from '../pages/Pay';
import PaySuccess from '../pages/PaySuccess';
import Center from '../pages/Center';

export default [
    {
        path: '/',
        redirect: '/home',
    },
    {
        name: 'home',
        path: '/home',
        component: Home,
        meta: { isShowNav: true },
    },
    {
        name: 'login',
        path: '/login',
        component: Login,
        meta: {
            isHiddenFooter: true,
        },
    },
    {
        name: 'register',
        path: '/register',
        component: Register,
        meta: {
            isHiddenFooter: true,
        },
    },
    {
        name: 'search',
        path: '/search/:keyword?',
        component: Search,
    },
    {
        name: 'detail',
        path: '/detail/:id',
        component: Detail,
        props: true, // 添加了这一行代码，会将之前传入的params参数直接用props来接收
    },
    {
        name: 'addcartsuccess',
        path: '/addcartsuccess/:skuNum?',
        component: AddCartSuccess,
    },
    {
        name: 'shopcart',
        path: '/shopcart',
        component: ShopCart,
    },
    {
        name: 'trade',
        path: '/trade',
        component: Trade,
    },
    {
        name: 'pay',
        path: '/pay',
        component: Pay,
    },
    {
        name: 'paySuccess',
        path: '/paySuccess',
        component: PaySuccess,
    },
    {
        name: 'center',
        path: '/center',
        component: Center,
    },
];
